package graph.drawingshapes.shapes
{
	import flash.display.Shape;
	
	public class DrawingShapeFactory
	{		
		public static function createShape(shapeName:String, x:Number=DrawingShape.DefaultX, y:Number=DrawingShape.DefaultY, width:Number=DrawingShape.DefaultWidth, height:Number=DrawingShape.DefaultHeight):DrawingShape
		{
			var shape:DrawingShape = null;
			switch(shapeName)
			{
				case LineShape.NAME:
					shape = new LineShape(x, y, width, height);
					break;
				case EllipseShape.NAME:
					shape = new EllipseShape(x, y, width, height);
					break;
				case RectangleShape.NAME:
					shape = new RectangleShape(x, y, width, height);
					break;
				case TriangleShape.NAME:
					shape = new LineShape(x, y, width, height);
					break;
				case PolygonShape.NAME:
					shape = new PolygonShape(x, y, width, height);
					break;
			}
			return shape;
		}
	}
}